home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / ispell-3.1.18src / splitdict (.txt) < prev    next >
Microsoft Windows Help File Content  |  1994-01-25  |  3KB  |  57 lines

  1. : Use /bin/sh
  2. # $Id: splitdict,v 1.5 1994/01/25 07:12:06 geoff Exp $
  3. # Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
  4. # All rights reserved.
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of source code must retain the above copyright
  9. #    notice, this list of conditions and the following disclaimer.
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. #    notice, this list of conditions and the following disclaimer in the
  12. #    documentation and/or other materials provided with the distribution.
  13. # 3. All modifications to the source code must be clearly marked as
  14. #    such.  Binary redistributions based on modified source code
  15. #    must be clearly marked as modified versions in the documentation
  16. #    and/or other materials provided with the distribution.
  17. # 4. All advertising materials mentioning features or use of this software
  18. #    must display the following acknowledgment:
  19. #      This product includes software developed by Geoff Kuenning and
  20. #      other unpaid contributors.
  21. # 5. The name of Geoff Kuenning may not be used to endorse or promote
  22. #    products derived from this software without specific prior
  23. #    written permission.
  24. # THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
  25. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. # ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
  28. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34. # SUCH DAMAGE.
  35. #    Split a dictionary into posting-sized parts.
  36. #    Usage:
  37. #    splitdict byte-size file basename
  38. #    The split is only approximate, as it is done on a line basis.
  39. # $Log: splitdict,v $
  40. # Revision 1.5  1994/01/25  07:12:06  geoff
  41. # Get rid of all old RCS log lines in preparation for the 3.1 release.
  42. TMP=${TMPDIR:-/usr/tmp}/sd$$
  43. case "$#" in
  44.     3)
  45.     *)
  46.     echo Usage: splitdict byte-size file basename 1>&2
  47.     exit 1
  48. SIZE=$1
  49. DICT=$2
  50. BASE=$3
  51. trap '/bin/rm -f ${TMP}; exit 1' 1 2 15
  52. sq < $DICT > $TMP
  53. set X `wc -lc < $TMP`
  54. lines=`expr $2 / \( \( $3 + $SIZE - 1 \) / $SIZE \) + 1`
  55. split -$lines $TMP $BASE
  56. /bin/rm -f $TMP
  57.